<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.15"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Library Evolutionary Algorithms for Clustering (LEAC): include/dist_matrix_dissimilarity.hpp Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="leac_logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Library Evolutionary Algorithms for Clustering (LEAC)
   &#160;<span id="projectnumber">Version 1.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.15 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">dist_matrix_dissimilarity.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="dist__matrix__dissimilarity_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;</div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="preprocessor">#ifndef __DIST_MATRIX_DISSIMILARITY_HPP</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#define __DIST_MATRIX_DISSIMILARITY_HPP</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;</div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="matrix__triangular_8hpp.html">matrix_triangular.hpp</a>&quot;</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="dist_8hpp.html">dist.hpp</a>&quot;</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="keyword">namespace  </span><a class="code" href="namespacedist.html">dist</a> {</div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;  </div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="keyword">template</span> &lt; <span class="keyword">typename</span> T_FEATURE,</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;           <span class="keyword">typename</span> T_DIST,</div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;           <span class="keyword">typename</span> INPUT_ITERATOR</div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;           &gt;</div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<a class="code" href="classmat_1_1_matrix_triang.html">mat::MatrixTriang&lt;T_DIST&gt;</a></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<a class="code" href="namespacedist.html#aaeb5af123514085a10fe90ab286de265">getMatrixDissimilarity</a></div><div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="namespacedist.html#aaeb5af123514085a10fe90ab286de265">   42</a></span>&#160;(INPUT_ITERATOR                     aiiterator_instfirst,</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160; <span class="keyword">const</span> INPUT_ITERATOR               aiiterator_instlast,</div><div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160; <span class="keyword">const</span> <a class="code" href="structdist_1_1_dist.html">dist::Dist&lt;T_DIST,T_FEATURE&gt;</a> &amp;aifunc2p_dist</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160; )</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;{</div><div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;<span class="preprocessor">#ifdef __VERBOSE_YES</span></div><div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;  <span class="keyword">const</span> <span class="keywordtype">char</span>* lpc_labelFunc = <span class="stringliteral">&quot;dist::getMatrixDissimilarity&quot;</span>;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;  ++geiinparam_verbose;</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;  <span class="keywordflow">if</span> ( geiinparam_verbose &lt;= geiinparam_verboseMax ) {</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;    std::cout &lt;&lt; lpc_labelFunc </div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;              &lt;&lt; <span class="stringliteral">&quot;:  IN(&quot;</span> &lt;&lt; geiinparam_verbose &lt;&lt; <span class="stringliteral">&quot;)\n&quot;</span></div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;              &lt;&lt; <span class="stringliteral">&quot;(input aiiterator_instfirst[&quot;</span> &lt;&lt; *aiiterator_instfirst &lt;&lt; <span class="stringliteral">&quot;]\n&quot;</span></div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;              &lt;&lt; <span class="stringliteral">&quot; input const aiiterator_instlast[&quot;</span> &lt;&lt; *aiiterator_instlast &lt;&lt; <span class="stringliteral">&quot;]\n&quot;</span></div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;              &lt;&lt; <span class="stringliteral">&quot;\t input  aifunc2p_dista\n&quot;</span></div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;              &lt;&lt; <span class="stringliteral">&quot;\t)\n&quot;</span>;</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;  }</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;<span class="preprocessor">#endif //__VERBOSE_YES</span></div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;  <span class="keyword">const</span> <a class="code" href="common_8hpp.html#a3f6c33fb604556cdc425e7aa2289d009">uintidx</a> lui_numInstances =</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;    <a class="code" href="common_8hpp.html#a3f6c33fb604556cdc425e7aa2289d009">uintidx</a>(std::distance(aiiterator_instfirst,aiiterator_instlast));</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;  <a class="code" href="classmat_1_1_matrix_triang.html">mat::MatrixTriang&lt;T_DIST&gt;</a>  lomatrixtriagt_dissimilarity(lui_numInstances);</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;  <span class="keyword">const</span> INPUT_ITERATOR   lconstiterator_instfirst = aiiterator_instfirst;</div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    </div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;  <span class="keywordflow">for</span>(<a class="code" href="common_8hpp.html#a3f6c33fb604556cdc425e7aa2289d009">uintidx</a> lui_i = 0; lui_i &lt; lui_numInstances; lui_i++) {</div><div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    </div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;    <span class="keyword">const</span> T_FEATURE* linst_interi =</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;      ((<a class="code" href="classdata_1_1_instance.html">data::Instance&lt;T_FEATURE&gt;</a>*) *aiiterator_instfirst)-&gt;getFeatures();</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    INPUT_ITERATOR  linstiterator_j = lconstiterator_instfirst;</div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    </div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    <span class="keywordflow">for</span>(<a class="code" href="common_8hpp.html#a3f6c33fb604556cdc425e7aa2289d009">uintidx</a> lui_j = 0; lui_j &lt; lui_i; lui_j++) {</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;      </div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;      <span class="keyword">const</span> T_FEATURE* linst_interj =</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;        ((<a class="code" href="classdata_1_1_instance.html">data::Instance&lt;T_FEATURE&gt;</a>*) *linstiterator_j)-&gt;getFeatures();</div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;      </div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;      lomatrixtriagt_dissimilarity(lui_i,lui_j) = </div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;        aifunc2p_dist</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;        (linst_interi,</div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;         linst_interj,</div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;         <a class="code" href="classdata_1_1_instance.html">data::Instance&lt;T_FEATURE&gt;::getNumDimensions</a>()</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;         );</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;      ++linstiterator_j;</div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    }</div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    ++aiiterator_instfirst;</div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    lomatrixtriagt_dissimilarity(lui_i,lui_i) = T_DIST(0);</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;  }</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;<span class="preprocessor">#ifdef __VERBOSE_YES</span></div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;  <span class="keywordflow">if</span> ( geiinparam_verbose &lt;= geiinparam_verboseMax ) {</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    std::cout &lt;&lt; lpc_labelFunc</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;              &lt;&lt; <span class="stringliteral">&quot;: OUT(&quot;</span> &lt;&lt; geiinparam_verbose &lt;&lt; <span class="stringliteral">&quot;)\n&quot;</span></div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;              &lt;&lt; <span class="stringliteral">&quot;output mat::MatrixTriang: lomatrixtriagt_dissimilarity[&quot;</span></div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;              &lt;&lt; &amp;lomatrixtriagt_dissimilarity &lt;&lt; <span class="stringliteral">&quot;]\n&quot;</span>;</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    lomatrixtriagt_dissimilarity.<a class="code" href="classmat_1_1_matrix_triang.html#aacb099c45401a360461b2ec946330a1e">print</a>();</div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;  }      </div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;  --geiinparam_verbose;</div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;<span class="preprocessor">#endif //__VERBOSE_YES</span></div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;  <span class="keywordflow">return</span> lomatrixtriagt_dissimilarity;</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;}</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;  </div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;} <span class="comment">/*END namespace dist </span></div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;<span class="comment">   */</span></div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/*__DIST_MATRIX_DISSIMILARITY_HPP*/</span><span class="preprocessor"></span></div><div class="ttc" id="dist_8hpp_html"><div class="ttname"><a href="dist_8hpp.html">dist.hpp</a></div><div class="ttdoc">operations for the calculation of distances between objects</div></div>
<div class="ttc" id="namespacedist_html"><div class="ttname"><a href="namespacedist.html">dist</a></div><div class="ttdoc">Module for definition of distance between objects or instances.</div></div>
<div class="ttc" id="common_8hpp_html_a3f6c33fb604556cdc425e7aa2289d009"><div class="ttname"><a href="common_8hpp.html#a3f6c33fb604556cdc425e7aa2289d009">uintidx</a></div><div class="ttdeci">uint32_t uintidx</div><div class="ttdef"><b>Definition:</b> <a href="common_8hpp_source.html#l00020">common.hpp:20</a></div></div>
<div class="ttc" id="classmat_1_1_matrix_triang_html_aacb099c45401a360461b2ec946330a1e"><div class="ttname"><a href="classmat_1_1_matrix_triang.html#aacb099c45401a360461b2ec946330a1e">mat::MatrixTriang::print</a></div><div class="ttdeci">void print(std::ostream &amp;os=std::cout, const char aic_delimCoef=',', const char aic_delimRow='\n') const</div><div class="ttdef"><b>Definition:</b> <a href="matrix__triangular_8hpp_source.html#l00159">matrix_triangular.hpp:159</a></div></div>
<div class="ttc" id="structdist_1_1_dist_html"><div class="ttname"><a href="structdist_1_1_dist.html">dist::Dist</a></div><div class="ttdoc">Generic dist.</div><div class="ttdef"><b>Definition:</b> <a href="dist_8hpp_source.html#l00034">dist.hpp:34</a></div></div>
<div class="ttc" id="namespacedist_html_aaeb5af123514085a10fe90ab286de265"><div class="ttname"><a href="namespacedist.html#aaeb5af123514085a10fe90ab286de265">dist::getMatrixDissimilarity</a></div><div class="ttdeci">mat::MatrixTriang&lt; T_DIST &gt; getMatrixDissimilarity(INPUT_ITERATOR aiiterator_instfirst, const INPUT_ITERATOR aiiterator_instlast, const dist::Dist&lt; T_DIST, T_FEATURE &gt; &amp;aifunc2p_dist)</div><div class="ttdoc">Triangular distance matrix.</div><div class="ttdef"><b>Definition:</b> <a href="dist__matrix__dissimilarity_8hpp_source.html#l00042">dist_matrix_dissimilarity.hpp:42</a></div></div>
<div class="ttc" id="matrix__triangular_8hpp_html"><div class="ttname"><a href="matrix__triangular_8hpp.html">matrix_triangular.hpp</a></div><div class="ttdoc">matrix triangular</div></div>
<div class="ttc" id="classdata_1_1_instance_html"><div class="ttname"><a href="classdata_1_1_instance.html">data::Instance</a></div><div class="ttdoc">Patterns, usually vectors in a multidimensional space.</div><div class="ttdef"><b>Definition:</b> <a href="instance_8hpp_source.html#l00037">instance.hpp:37</a></div></div>
<div class="ttc" id="classmat_1_1_matrix_triang_html"><div class="ttname"><a href="classmat_1_1_matrix_triang.html">mat::MatrixTriang&lt; T_DIST &gt;</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Fri Apr 19 2019 08:58:31 for Library Evolutionary Algorithms for Clustering (LEAC) by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.15
</small></address>
</body>
</html>
